//
//  HomeMapCustomView.m
//  ReceiptDelivery
//
//  Created by 吕晶 on 2020/11/17.
//  Copyright © 2020 吕晶. All rights reserved.
//

#import "HomeMapCustomView.h"

@interface HomeMapCustomView ()

@property (nonatomic, strong) UILabel *titleLab;
@property (nonatomic, strong) UILabel *nameLab;
@property (nonatomic, strong) UILabel *pieceLab;
@property (nonatomic, strong) UILabel *weightLab;

@end

@implementation HomeMapCustomView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.titleLab = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, 190, 21)];
        self.titleLab.textColor = HexColor(0x333333);
        self.titleLab.font = BoldFontOfSize(20);
        [self addSubview:self.titleLab];
        
        self.nameLab = [[UILabel alloc] initWithFrame:CGRectMake(5, self.titleLab.nim_bottom + 10, 190, 17)];
        self.nameLab.textColor = HexColor(0x444444);
        self.nameLab.font = [UIFont systemFontOfSize:16];
        [self addSubview:self.nameLab];
        
        self.pieceLab = [[UILabel alloc] initWithFrame:CGRectMake(5, self.nameLab.nim_bottom + 5, 95, 17)];
        self.pieceLab.textColor = HexColor(0x444444);
        self.pieceLab.font = [UIFont systemFontOfSize:16];
        [self addSubview:self.pieceLab];
        
        self.weightLab = [[UILabel alloc] initWithFrame:CGRectMake(self.pieceLab.nim_right, self.nameLab.nim_bottom + 5, 95, 17)];
        self.weightLab.textColor = HexColor(0x444444);
        self.weightLab.font = [UIFont systemFontOfSize:16];
        [self addSubview:self.weightLab];
    }
    return self;
}

-(void)setModel:(HomeAnnotation *)model {
    _model = model;
    self.titleLab.text = model.wa_num;
    self.nameLab.text = [NSString stringWithFormat:@"收货方：%@",model.shippers_name];
    self.pieceLab.text = [NSString stringWithFormat:@"件数：%@",model.goodsJnum];
    self.weightLab.text = [NSString stringWithFormat:@"数量：%@",model.goodsNum];
}

- (CGSize)intrinsicContentSize{
    return CGSizeMake(200, 80);
}


@end
